package com.smart.manager.system.entities.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.system.entities.assembler.MenuMeta;
import com.smart.manager.system.entities.enums.DictRwState;
import com.smart.manager.system.entities.enums.DictState;
import com.smart.manager.system.entities.enums.MenuAttribute;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;


public class RSystemMenu {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RSystemMenu1")
    public static class SearchBody extends BaseSearch {


        @ApiModelProperty("字典代码")
        private String code;


        @ApiModelProperty("字典名称")
        private String name;


        @ApiModelProperty("调用状态")
        private DictState state;
        @ApiModelProperty("读写权限")
        private DictRwState rwState;
    }


    @Data
    @ApiModel("RSystemMenu2")
    public static class EditBody implements Serializable {


        @ApiModelProperty("上级菜单ID")
        @NotNull(message = "上级菜单 不能为空")
        private Long parentId;


        @ApiModelProperty("菜单地址")
        @NotBlank(message = "菜单地址 不能为空")
        private String path;


        @ApiModelProperty("组件名称")
        @NotBlank(message = "组件名称 不能为空")
        private String name;


        @ApiModelProperty("组件路径")
        @NotBlank(message = "组件路径 不能为空")
        private String component;


        @ApiModelProperty("显示排序")
        @NotNull(message = "显示排序 不能为空")
        private int sort;


        @ApiModelProperty("菜单元属性")
        @NotNull(message = "菜单元属性 不能为空")
        private MenuMeta meta;


        @ApiModelProperty("API-TOKEN列表")
        @NotNull(message = "TOKEN列表 不能为空")
        private List<String> apiTokens;


        @ApiModelProperty("菜单属性")
        @NotNull(message = "菜单属性不能为空")
        private MenuAttribute attribute;

    }


}
